// cloudfunctions/uploadImage/index.js
'use strict';
exports.main = async (event, context) => {
	
  const { fileBuffer, cloudPath } = event;
 
  try {
    const uploadResult = await uniCloud.uploadFile({
      fileBuffer: fileBuffer,
      cloudPath: cloudPath
    });
    return {
      status: 'success',
      data: uploadResult
    };
  } catch (e) {
    return {
      status: 'error',
      errorMessage: e.message,
	  event:event
    };
  }
};